package com.longshanks.retrorally;

public class RaceCar {

	public static final String TAG = RaceCar.class.getSimpleName();
	
	public static final int STANDING_STILL = 0;	
	
	private int speed;
	private int maxSpeed;
	private float steerDirection;
	private float movementDirection;
	private float maneuverability;
	private float acceleration;
	private float deceleration;
	private float tyreFriction;

	public RaceCar(int speed, float steerDirection,  float maneuverability, int maxSpeed, float acceleration,
			float deceleration, float tyreFriction) {
		super();
		this.speed = speed;
		this.steerDirection = this.movementDirection = steerDirection;
		this.maneuverability = maneuverability;
		this.maxSpeed = maxSpeed;
		this.acceleration = acceleration;
		this.deceleration = deceleration;
		this.tyreFriction = tyreFriction;
	}

	public int getSpeed() {
		return speed;
	}

	public void setSpeed(int speed) {
		this.speed = MathHelper.clamp(speed, maxSpeed / -2, maxSpeed);
	}

	public float getManeuverability() {
		return maneuverability;
	}
	
	public void setManeuverability(float maneuverability) {
		this.maneuverability = maneuverability;
	}
	
	public int getMaxSpeed() {
		return maxSpeed;
	}
	
	public void setMaxSpeed(int maxSpeed) {
		this.maxSpeed = maxSpeed;
	}
	
	public float getAcceleration() {
		return acceleration;
	}
	
	public void setAcceleration(float acceleration) {
		this.acceleration = acceleration;
	}
	
	public float getDeceleration() {
		return deceleration;
	}
	
	public void setDeceleration(float deceleration) {
		this.deceleration = deceleration;
	}
	
	public float getTyreFriction() {
		return tyreFriction;
	}
	
	public void setTyreFriction(float tyres) {
		this.tyreFriction = tyres;
	}

	public float getSteerDirection() {
		return steerDirection;
	}

	public void setSteerDirection(float steerDirection) {
		this.steerDirection = (steerDirection + 360) % 360;
	}

	public float getMovementDirection() {
		return movementDirection;
	}

	public void setMovementDirection(float movementDirection) {
		this.movementDirection = (movementDirection + 360) % 360;
	}
}
